<?php

/**
 * @Author: zhibinm (113664000@qq.com)
 * @Date:   2018-04-13 11:45:03 
 * @Copyright:   xuebingsi
 * @Last Modified by:   Zhibinm
 * @Last Modified time: 2018-04-13 11:54:17
 */
$data = file_get_contents("http://news.china.com/domestic/945/20180413/32305072.html");

$preg  = "/<h1 id=\"chan_newsTitle\">(.+?)<\/h1>/";


$c = preg_match_all($preg,$data,$out);

var_dump($c);

var_dump($out);


$preg = "/<p class=\"f_center pcenter\">(.+?)<\/div>/s";

$c = preg_match_all($preg,$data,$out);

var_dump($c);

var_dump($out);

file_put_contents('./new.txt',json_encode($out[1][0],JSON_UNESCAPED_UNICODE));

